package co.com.inventarios.modelo;

import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * RequiPro entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "REQUI_PRO", schema = "MANAGER", uniqueConstraints = {})
public class RequiPro implements java.io.Serializable {

	// Fields

	private RequiProId id;
	private Unimed unimed;
	private RequiDoc requiDoc;
	private Label label;
	private Cataventa cataventa;
	private Producto producto;
	private Double rqpcantReq;
	private Double rqpcantEnt;
	private Double rqpprecio;
	private Timestamp rqplogfec;
	private Dlluser dlluser;
	// Constructors

	/** default constructor */
	public RequiPro() {
	}

	/** minimal constructor */
	public RequiPro(RequiProId id, Unimed unimed, RequiDoc requiDoc,
			Dlluser dlluser,Timestamp rqplogfec,
			Cataventa cataventa, Producto producto) {
		this.id = id;
		this.dlluser = dlluser;
		this.rqplogfec = rqplogfec;
		this.unimed = unimed;
		this.requiDoc = requiDoc;
		this.cataventa = cataventa;
		this.producto = producto;
	}

	/** full constructor */
	public RequiPro(RequiProId id, Unimed unimed, RequiDoc requiDoc,
			Label label, Cataventa cataventa, Producto producto,
			Double rqpcantReq, Double rqpcantEnt, Double rqpprecio) {
		this.id = id;
		this.unimed = unimed;
		this.requiDoc = requiDoc;
		this.label = label;
		this.cataventa = cataventa;
		this.producto = producto;
		this.rqpcantReq = rqpcantReq;
		this.rqpcantEnt = rqpcantEnt;
		this.rqpprecio = rqpprecio;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "rqpempresa", column = @Column(name = "RQPEMPRESA", unique = false, nullable = false, insertable = true, updatable = true, length = 3)),
			@AttributeOverride(name = "rqpclase", column = @Column(name = "RQPCLASE", unique = false, nullable = false, insertable = true, updatable = true, length = 4)),
			@AttributeOverride(name = "rqptipo", column = @Column(name = "RQPTIPO", unique = false, nullable = false, insertable = true, updatable = true, length = 4)),
			@AttributeOverride(name = "rqpnumero", column = @Column(name = "RQPNUMERO", unique = false, nullable = false, insertable = true, updatable = true, precision = 13, scale = 1)),
			@AttributeOverride(name = "rqpreg", column = @Column(name = "RQPREG", unique = false, nullable = false, insertable = true, updatable = true, precision = 7, scale = 1)) })
	public RequiProId getId() {
		return this.id;
	}

	public void setId(RequiProId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RQPUNIMED", unique = false, nullable = false, insertable = true, updatable = true)
	public Unimed getUnimed() {
		return this.unimed;
	}
	
	public void setUnimed(Unimed unimed) {
		this.unimed = unimed;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "RQPEMPRESA",referencedColumnName = "REQEMPRESA" , unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "RQPCLASE",  referencedColumnName = "REQCLASE" , unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "RQPTIPO",   referencedColumnName = "REQTIPO" , unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "RQPNUMERO", referencedColumnName = "REQNUMERO" , unique = false, nullable = false, insertable = false, updatable = false) })
	public RequiDoc getRequiDoc() {
		return this.requiDoc;
	}

	
	public void setRequiDoc(RequiDoc requiDoc) {
		this.requiDoc = requiDoc;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RQPESTADO", unique = false, nullable = true, insertable = true, updatable = true)
	public Label getLabel() {
		return this.label;
	}

	public void setLabel(Label label) {
		this.label = label;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RQPCATALOG", unique = false, nullable = false, insertable = true, updatable = true)
	public Cataventa getCataventa() {
		return this.cataventa;
	}

	public void setCataventa(Cataventa cataventa) {
		this.cataventa = cataventa;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RQPPRODUCT", unique = false, nullable = false, insertable = true, updatable = true)
	public Producto getProducto() {
		return this.producto;
	}

	public void setProducto(Producto producto) {
		this.producto = producto;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RQPLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "RQPLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getRqplogfec() {
		return this.rqplogfec;
	}

	public void setRqplogfec(Timestamp rqplogfec) {
		this.rqplogfec = rqplogfec;
	}
	
	@Column(name = "RQPCANT_REQ", unique = false, nullable = true, insertable = true, updatable = true, precision = 12)
	public Double getRqpcantReq() {
		return this.rqpcantReq;
	}

	public void setRqpcantReq(Double rqpcantReq) {
		this.rqpcantReq = rqpcantReq;
	}

	@Column(name = "RQPCANT_ENT", unique = false, nullable = true, insertable = true, updatable = true, precision = 12)
	public Double getRqpcantEnt() {
		return this.rqpcantEnt;
	}

	public void setRqpcantEnt(Double rqpcantEnt) {
		this.rqpcantEnt = rqpcantEnt;
	}

	@Column(name = "RQPPRECIO", unique = false, nullable = true, insertable = true, updatable = true, precision = 12)
	public Double getRqpprecio() {
		return this.rqpprecio;
	}

	public void setRqpprecio(Double rqpprecio) {
		this.rqpprecio = rqpprecio;
	}

}